home *** CD-ROM | disk | FTP | other *** search
- ;-----------------------------------------------------------PowerPPL v2.1----
- ; File : AGSTUT2.PPS
- ; Original by : LONE RUNNER on 04/16/1995 at 17:07:22
- ; Last update by : LONE RUNNER on 04/16/1995 at 17:44:56
- ;----------------------------------------------------------------------------
- ;$USEFUNCS
- ;----------------------------------------------------------------------------
- Declare Procedure DispSel(Integer Seln)
- Declare Procedure EraseSel(Integer Seln)
- Declare Procedure EraseCursor()
- ;----------------------------------------------------------------------------
- Int Sel
- String k, BakLightBar
- ;----------------------------------------------------------------------------
-
-
- Begin
-
- ;■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ Non Stop Display
- StartDisp FNS
- ;■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ First Selection is #1
- Sel = 1
-
- ;■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ Menu Entry Point
- :Restart
-
- ;■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ Clear Screen
- CLS
- ;■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ Display menu (language aware)
- DispFile PPEPath()+"MENU", GRAPH+LANG
-
- ;■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ Display lightbar on current selection
- DispSel(Sel)
-
- ;■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ Endless loop
- While (1) Do
- ;■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ Get a keypress
- k = Inkey()
- If (k <> "") Then
- Select case k
- ;■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ Did we hit the DOWN key?
- Case "DOWN"
- ;■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ Erase selection
- EraseSel(Sel)
- ;■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ Inc selection
- Sel = Sel + 1
- ;■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ Test for the middle line
- If (Sel = 3) Sel = 4
- ;■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ Test for the end of menu
- If (Sel = 6) Sel = 1
- ;■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ Display selection
- DispSel(Sel)
- ;■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ Did we hit the UP key?
- Case "UP"
- ;■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ Erase selection
- EraseSel(Sel)
- ;■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ Dec selection
- Sel = Sel - 1
- ;■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ Test for the middle line
- If (Sel = 3) Sel = 2
- ;■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ Test for the beginning of menu
- If (Sel = 0) Sel = 5
- ;■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ Display selection
- DispSel(Sel)
- ;■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ Did we hit the ENTER key?
- Case Chr(13)
- If (Sel = 1) Then
- ;■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ Do stuff for option1
- ;
- ;
- ;
- ;■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ Restart menu
- Goto Restart
- Else If (Sel = 2) Then
- ;■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ Do stuff for option2
- ;
- ;
- ;
- ;■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ Restart menu
- Goto Restart
- Else If (Sel = 4) Then
- ;■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ Do stuff for option3
- ;
- ;
- ;
- ;■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ Restart menu
- Goto Restart
- Else If (Sel = 5) Then
- ;■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ Do stuff for option4
- ;
- ;
- ;
- ;■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ Restart menu
- Goto Restart
- End If
- ;■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ Did we hit the ESC key?
- Case Chr(27)
- ;■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ Get out of here!
- Break
- End Select
- EndIf
- EndWhile
- ;■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ Terminate the program
- End
- ;----------------------------------------------------------------------------
- ;■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ Display the selection
- ;
- ;
- Procedure DispSel(Integer Seln)
- ;■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ Move to the right line & column
- AnsiPos 22,11+Seln-1
- ;■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ Save the string with colors
- BakLightBar = ScrText(22,11+Seln-1,36,True)
- ;■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ Print the string as selected
- Print "@X1F",ScrText(22,11+Seln-1,36,False)
- ;■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ Erase cursor
- EraseCursor()
- Endproc
- ;----------------------------------------------------------------------------
- ;■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ Erase The selection
- ;
- ;
- Procedure EraseSel(Integer Seln)
- ;■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ Move to the right line & column
- AnsiPos 22,11+Seln-1
- ;■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ Print bak the previously saved string
- Print "@X0F",BakLightBar
- ;■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ Erase cursor
- EraseCursor()
- Endproc
- ;----------------------------------------------------------------------------
- ;■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ Erase cursor
- ;
- ;
- Procedure EraseCursor()
- ;■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ Move to coordinates 1,22
- AnsiPos 1,22
- ;■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ Switch to color 0 (black on black)
- Color 0
- ;■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ Print a space
- Print " "
- ;■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ Move back to 1,22, cursor is now hidden!
- Backup 1
- EndProc
-